package com.taxshare.purchaser.controller;

import com.taxshare.purchaser.entity.InvoiceCollectionEntity;
import com.taxshare.purchaser.service.InvoiceCollectService;
import com.taxshare.purchaser.view.dto.CheckInvoiceDTO;
import com.taxshare.purchaser.view.dto.HandEnterDTO;
import com.taxshare.purchaser.view.dto.ImageUploadInvoiceDTO;
import com.taxshare.purchaser.view.dto.InterfaceInvoiceDTO;
import com.taxshare.response.beans.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @ClassName: InvoiceCollectController
 * @Description:
 * @author: hjh
 * @date: 2021/5/24 15:33
 */
@RestController
@RequestMapping(value = "/otherInvoiceCollection")
@Api(tags = "发票采集（他方调用）")
public class InvoiceCollectController {

    @Autowired
    private InvoiceCollectService invoiceCollectService;

    @ApiOperation(value = "上传图片识别", notes = "发票采集")
    @PostMapping("/uploadInvoiceImage")
    public Response uploadInvoiceImage(@RequestBody ImageUploadInvoiceDTO imageUploadInvoiceDTO) {
        return invoiceCollectService.uploadInvoiceImage(imageUploadInvoiceDTO);
    }

    @PostMapping("/invoiceCheck")
    @ApiOperation(value = "发票查验", notes = "发票采集")
    public Response invoiceCheck(@RequestBody HandEnterDTO handEnterDTO) {
        return invoiceCollectService.checkInvoiceSync(handEnterDTO);
    }

    @PostMapping("/query")
    @ApiOperation(value = "发票采集信息查询", notes = "发票采集")
    public Response<InvoiceCollectionEntity> invoiceCollectionQuery(@RequestBody InterfaceInvoiceDTO dto) {
        return invoiceCollectService.invoiceCollectionQuery(dto);
    }

}
